<%@page contentType="text/html" pageEncoding="UTF-8" isELIgnored="true" import="java.util.List"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Modulo de Programacion de Curso » Consultar Curso</title>
        <style>
            td {
                font-family: tahoma;
                font-size:11px;
            }
            a {
                font-family:tahoma;
                font-size: 11px;
                color:#000000;
                font:900;
                text-decoration:underline;
            }
            a:visited {
                color:#ffffff;
            }
            a:hover {
                color:red;
            }
            .bold {
                font:900;
            }
            .right {
                font-size:12px;
                font-family:verdana;
            }
            a.menu {
                color:#1C5679;
                font-size:11px;
                text-decoration:none;
                font:100
            }
            a.menu:hover {
                color:red;
            }
            a.menu:visited {
                color:#1C5679;
            }
        </style>
        <link href="css/estilo.css" media="screen" type="text/css" rel="stylesheet"/>
        <link href="css/new.css" media="screen" type="text/css" rel="stylesheet"/>        
        <link href="css/estilo_christian.css" rel="stylesheet" type="text/css"/>
        <script src="js/consultar_curso.js" type="text/javascript"></script>
    </head>
    <body>
        <table border="0" cellpadding="0" cellspacing="0">
            <%@include file="jspf/cabecera.jspf"%>
            <tr>
                <td valign="top" width="265"><table border="0" cellpadding="0" cellspacing="0" width="197">
                        <tr>
                            <td><img src="imagenes/comp_solution.jpg" border="0" width="197" height="60" alt=""/></td>
                        </tr>
                        <tr>
                            <td align="center"><font style="font-size:15px"><b>Modulo de<br>
                                        Programaci&oacute;n de Curso<br>
                                CEUPS</b></font>
                            </td>
                        </tr>
                        <%@include file="jspf/barra_opciones.jspf"%>
                    </table>
                </td>
                <td valign="top" width="640"><table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td colspan="3"><img src="imagenes/new_products.jpg" border="0" width="603" height="24" alt=""/></td>
                        </tr>
                        <tr>
                            <td colspan="3" background="imagenes/win4_back.jpg" style="padding-left:40px;padding-right:10px">
                                <div id="formulario_consultar">
                                    <form action="ControladorCurso" method="post" id="form_consultar_curso" class="letra_contenido" 
                                    onsubmit="return validarNumero()">
                                        <input type="hidden" name="operacion" value="0">
                                        <table width="260" border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td width="147" height="25"><label>Estado de Curso:</label></td>
                                                <td width="113">
                                                    <select name="estado_curso" class="letra_contenido" id="estado_curso"
                                                    onchange="actualizar_etiqueta()">
                                                        <option value="1" <c:if test="${estado_curso == '1'}">selected</c:if>>No Aperturado</option>
                                                        <option value="0" <c:if test="${estado_curso == '0'}">selected</c:if>>Aperturado</option>                                                        
                                                    </select>              
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="25"><label>Numero de Pre-Inscritos:</label></td>
                                                <td colspan="2">                                                    
                                                    <input name="numero_preinscritos" type="text" class="letra_contenido" id="numero_preinscritos"
                                                    <c:choose>                                                        
                                                        <c:when test="${estado_curso == '0'}">
                                                            value="" disabled
                                                        </c:when>
                                                        <c:otherwise>
                                                            value="<c:out value="${numero_preinscritos}" default="8"/>"
                                                        </c:otherwise>
                                                    </c:choose>
                                                    size="1" maxlength="2"/> (como minimo)
                                                </td>
                                            </tr>
                                            <tr>
                                                <td height="27">&nbsp;</td>
                                                <td colspan="2">                                
                                                    <input name="btn_consultar" type="image"  src="imagenes/consultar.png" alt=""  border="0"/>
                                                </td>
                                            </tr>
                                        </table>
                                        <label></label>
                                    </form>
                                </div>
                                <br>
                                <br>
                                <c:if test="${num_cursos != null}">
                                    <c:choose>
                                        <c:when test="${num_cursos == 0}">
                                            <div class="mensaje_error">No hay Cursos</div>
                                        </c:when>
                                        <c:otherwise>
                                            <table cellspacing="0" class="tv-table-deals" summary="">
                                                <tbody>
                                                    <tr>
                                                        <th width="13%" class="borde_izq_columna" abbr="Configurations" scope="col">Codigo</th>                                                        
                                                        <c:choose>
                                                            <c:when test="${estado_curso == '0'}">
                                                                <th width="44%" abbr="Configurations" scope="col">Nombre</th>
                                                                <th width="19%" abbr="Configurations" scope="col">Fecha de Inicio</th>
                                                                <th width="24%" abbr="Configurations" scope="col">Numero de Inscritos</th>
                                                            </c:when>
                                                            <c:when test="${estado_curso == '1'}">
                                                                <th width="59%" abbr="Configurations" scope="col">Nombre</th>
                                                                <th width="28%" abbr="Configurations" scope="col">Numero de Pre-Inscritos</th>
                                                            </c:when>
                                                        </c:choose>                                                        
                                                    </tr>
                                                    <c:set var="contador" value="${0}" scope="page"/>
                                                    <c:set var="estilo_fila" value="${''}" scope="page"/>
                                                    <c:forEach var="curso" items="${cursos}">
                                                        <c:choose>
                                                            <c:when test="${contador == 0}">
                                                                <c:set var="estilo_fila" value="${'spec'}" scope="page"/>
                                                                <c:set var="contador" value="${1}" scope="page"/>
                                                            </c:when>
                                                            <c:otherwise>
                                                                <c:set var="estilo_fila" value="${'specalt'}" scope="page"/>
                                                                <c:set var="contador" value="${0}" scope="page"/>
                                                            </c:otherwise>
                                                        </c:choose>
                                                        <tr>
                                                            <th scope="row" class="<c:out value="${estilo_fila}"/>"><c:out value="${curso[0]}"/></th>
                                                            <th scope="row" class="<c:out value="${estilo_fila}"/>"><c:out value="${curso[1]}"/></th>
                                                            <c:choose>
                                                                <c:when test="${estado_curso == '0'}">
                                                                    <th scope="row" class="<c:out value="${estilo_fila}"/>"><c:out value="${curso[2]}"/></th>
                                                                    <th scope="row" class="<c:out value="${estilo_fila}"/>"><div align="center"><c:out value="${curso[3]}"/></div></th>
                                                                </c:when>
                                                                <c:when test="${estado_curso == '1'}">
                                                                    <th scope="row" class="<c:out value="${estilo_fila}"/>"><div align="center"><c:out value="${curso[2]}"/></div></th>
                                                                </c:when>
                                                            </c:choose>                                                            
                                                        </tr>
                                                    </c:forEach>
                                                </tbody>
                                            </table>    
                                        </c:otherwise>
                                    </c:choose>                                    
                                </c:if>                                                                                    
                                <br><br><br><br><br>
                            </td>
                        </tr>
                    </table>
                    <table border="0" cellpadding="0" cellspacing="0">
                        <tr>
                            <td colspan="5"><img src="imagenes/bottom2.jpg" border="0" width="603" height="9" alt=""></td>
                        </tr>
                </table></td>
            </tr>
            <tr>
                <td height="22" colspan="2">
                    <%@include file="jspf/pie_pagina.jspf"%>
                </td>
            </tr>
        </table>
    </body>
</html>